package com.heima.search.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.search.dtos.UserSearchDto;
import com.heima.search.service.impl.AppAssociateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 自动补全控制器
 *
 * @author DiXiaoNie
 * @date 2023/01/03
 * @since 2023/1/3 9:38
 */
@RestController
@RequestMapping("/api/v1/associate")
public class AppAssociateController {
    @Autowired
    private AppAssociateService appAssociateService;


    /**
     * 自动补全
     *
     * @param dto dto
     * @return {@link ResponseResult }
     * @author DiXiaoNie
     * @date 2023/01/03
     */
    @PostMapping("/search")
    public ResponseResult complete(@RequestBody UserSearchDto dto) {

        return this.appAssociateService.complete(dto);
    }

}
